package com.liang.controller;


import com.liang.pojo.Armyalluserz;
import com.liang.empty.Result;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
import java.util.HashMap;
import org.springframework.beans.factory.annotation.Autowired;;
import java.util.List;
import com.liang.service.ArmyalluserzService;
/**
 *@作者:lsk
 *Controller接口
 *@Date:2023/10/20
*/
@RestController
@RequestMapping("/ArmyalluserzURL")
public class ArmyalluserzController {


	@Autowired
	private ArmyalluserzService armyalluserzservice;




	/**
	 insert:(插入)
	*/
	@PostMapping("/insert")
	public Result insert(@RequestBody Armyalluserz demo){
		Result.buildSuccess(armyalluserzservice.insert(demo));
		return Result.buildSuccess(demo);
	}



	/**
	 insertOrUpdate(插入或更新(根据主键或唯一索引更新，主键和唯一索引不会改变))
	*/
	@PostMapping("/insertOrUpdate")
	public Result insertOrUpdate(@RequestBody Armyalluserz demo){
		return Result.buildSuccess(armyalluserzservice.insertOrUpdate(demo));
	}



	/**
	 insertBath:(批量插入)
	*/
	@PostMapping("/insertBatch")
	public Result insertBatch(@RequestBody List<Armyalluserz> list){
		return Result.buildSuccess(armyalluserzservice.insertBatch(list));
	}



	/**
	 insertOrUpdateBatch:(批量插入或更新)
	*/
	@PostMapping("/insertOrUpdateBatch")
	public Result insertOrUpdateBatch(@RequestBody List<Armyalluserz> list){
		return Result.buildSuccess(armyalluserzservice.insertOrUpdateBatch(list));
	}



	/**
	 selectList:(根据参数查询集合)
	*/
	@PostMapping("/selectList")
	public Result selectList(@RequestBody Map<String,Object> param){

		return Result.buildSuccess(armyalluserzservice.selectList(param),armyalluserzservice.selectCount(param));
	}



	/**
	 selectCount:(根据集合查询数量)
	*/
	@PostMapping("/selectCount")
	public Result selectCount(@RequestBody Map<String,Object> param){
		return Result.buildSuccess(armyalluserzservice.selectCount(param));
	}



}